package com.deke.home.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.deke.entity.TbHeadNav;
import com.deke.home.dao.TbHeadNavDao;
import com.deke.home.service.QianHeadService;
import com.deke.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ：Username 刘亦辰（59372312@qq.com）
 * @date ：Created in 2022/12/21 15:41
 * @description：
 * @modified By：
 * @version:
 **/
@Service
public class QianHeadServiceImpl implements QianHeadService {
    @Autowired
    private TbHeadNavDao headNavDao;


    /**
     * @create by: Username 刘亦辰 
     * @description: 查询前台头部导航栏 
     * @create time: 2022/12/21 15:45
     * @param null
     * @return :  
     **/
    @Override
    public Result getAllHead() {
        QueryWrapper<TbHeadNav> wrapper = new QueryWrapper<>();
        wrapper.eq("is_delete",0);
        wrapper.eq("is_disable",0);
        List<TbHeadNav> tbHeadNavs = headNavDao.selectList(wrapper);
        if (ObjectUtil.isNotEmpty(tbHeadNavs) && tbHeadNavs.size()>0){
            return new Result(2000,"成功",tbHeadNavs);
        }
        return new Result(0000,"失败");
    }
}